package com.explorati.design_pattern.creational.singleton;

/**
 * Effectiv Java中推荐使用的单例类型
 * 
 * @author explorati
 *
 */
public enum EnumInstance {

	INSTANCE {
		protected void printTest() {
			System.out.println("Print test");
		}
	};

	//需要和上面的名称一样
	protected abstract void printTest();

	private Object data;

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public static EnumInstance getInstance() {
		return INSTANCE;
	}
}
